<?php
/**
 * 项目审批反馈
 * User: zhao shou qiang
 * Date: 2018/1/17 0017
 * Time: 10:22
 */

use yii\helpers\Html;
use yii\helpers\Url;
use yii\grid\GridView;
use backend\assets\AppAsset;

/* @var $this yii\web\View */
/* @var $searchModel common\models\ProjectInvestigationSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

AppAsset::register($this);

$this->title = '审核情况';
//$this->params['breadcrumbs'][] = $this->title;

$this->registerCssFile('@web/css/projectInvestigation/assessment.css', ['depends' => ['backend\assets\AppAsset'], 'position' => $this::POS_HEAD]);
AppAsset::addScript($this, '@web/js/projectInvestigation/assessment.js');
AppAsset::addScript($this, '@web/js/projectAudit.js');
AppAsset::addScript($this, '@web/js/single-project-top-img.js');

?>

<style type="text/css">
.access_audit {
    margin-top: 0px!important;
}
.content2 {
	top: 10px!important;
}
</style>

<!-- 4.模态窗口    开始  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!-->
<input type="hidden" class="btn btn-primary btn-lg modal_log_show" data-toggle="modal"
       data-target="#AssetPackageEditing-approval-log"/>
<!-- Modal -->
<div class="modal fade" id="AssetPackageEditing-approval-log" tabindex="-1" role="dialog"
     aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true"><img src="/image/assetPackage/close.png"></span></button>
                <div class="pull-left modal-nav">
                    <img src="/image/assetPackage/white.png" class="pull-left">
                    <span class="pull-left">审批意见</span>
                </div>
            </div>
            <div class="modal-body-approval">
                <div class="modal-body-approval-div">
                    <pre style="font-size: 14px; font-family: 'Microsoft YaHei', Tahoma, Arial;background: #fff;color: #333;border: none;">
                        数据更新记录操作详情
                    </pre>
                </div>
            </div>

            <div class="modal-footer">
                <button type="button" class="btn btn-primary btns-primary modal_log_btn">确定</button>
            </div>
        </div>
    </div>
</div>
<!-- 模态窗口  结束!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

<!-- 删除模态框开始（Modal） -->
<div class="container-fluid text-center">
    <div class="row">
        <div class="modal fade" id="deleModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
             aria-hidden="false">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header clearfix">
                        <div class="pull-left">
                            <?php echo Html::img('@web/image/officeHall/uploadAssetPackage/mask.png', ['class' => 'pull-left']); ?>
                            <span class="pull-left uploadText">删除选项</span>
                        </div>
                        <?php echo Html::img('@web/image/officeHall/uploadAssetPackage/clos.png',
                            ['class' => 'pull-right uploadImg', 'data-dismiss' => 'modal', 'aria-hidden' => 'true', 'title' => '单击关闭遮罩层', 'style' => 'margin-top: 10px; cursor: pointer;']); ?>
                    </div>
                    <div class="modal-body">
                        <p>你确定删除选中内容吗?</p>
                    </div>
                    <div class="modal-footer" style="display: block;">
                        <div class="cancelInConfirm">
                            <input id='modal-cancel' class="cancelInConfirmActive" type="button" value="确定"
                                   data-dismiss="modal"/>
                            <input id="modal-confirm" class="active" type="button" value="取消" data-dismiss="modal"/>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!--删除模态框结束-->


<?php echo \Yii::$app->view->renderFile('@app/views/project/project-detail-top.php', ['Base' => $topData['Base'], 'packageName' => $topData['packageName'],
    'data'=>$topData,'userChief'=>$data['userChief'],'user'=>$data['user'], 'teamInfo'=>$topData['teamInfo'], 'projectModel'=>$projectModel,
    'team'=>$data['team'],'teamXZR'=>$data['teamXZR'], 'teamFZR'=>$data['teamFZR'],'teamZJ'=>$data['teamZJ']]); ?>


<!-- 页内导航   开始-->
<div class="container edit-tabs navFix">
    <div class="row">
        <div class="navFixTop"></div>
        <ul class="edit-tabs-ul1">
            <li class="pull-left edit-tabs-li1">
                <a href="<?php echo Url::toRoute(['project/getinfodata', 'package_id' => $packageId, 'project_id'
                => $projectId]); ?>">预评估信息</a>
                <!--//通过判断展示响应的ul-->
                <ul class="edit-tabs-ul2 myActiveBox" style="display: none;">
                    <li class="pull-left myActive">
                        <a href="###">基本信息</a>
                    </li>
                    <li class="pull-left prohibit">
                        <a href="###">司法进展</a>
                    </li>
                    <li class="pull-left ">
                        <a href="###">价值评估</a>
                    </li>
                    <li class="pull-left ">
                        <a href="###">补充说明</a>
                    </li>
                    <li class="pull-left ">
                        <a href="###">转让信息</a>
                    </li>
                    <li class="pull-left ">
                        <a href="###">流转、前期处置及维护情况</a>
                    </li>
                    <li class="pull-left ">
                        <a href="###">团队成员</a>
                    </li>
                </ul>
            </li>
            <!--//经过判断展示相应的的ul-->
            <li class="pull-left edit-tabs-li1 myActiveBox">
                <a href="<?php echo Url::toRoute(['project-investigation/index', 'package_id' => $packageId,
                    'project_id' => $projectId]); ?>">尽调报告</a>
                <ul class="edit-tabs-ul2" style="display: none;">
                    <li class="pull-left myActive">
                        <a data-href="#zhaiQuan">债权基本情况</a>
                    </li>
                    <li class="pull-left prohibit">
                        <a data-href="#jieKuan">借款人及资产情况</a>
                    </li>
                    <li class="pull-left ">
                        <a data-href="#baoZheng">保证人及资产情况</a>
                    </li>
                    <li class="pull-left ">
                        <a data-href="#diYa">抵押人及抵押物情况</a>
                    </li>
                    <li class="pull-left ">
                        <a data-href="#qiTa">其他承债人及资产情况</a>
                    </li>
                    <li class="pull-left guanJian">
                        <a data-href="#zongJie">尽调评估总结</a>
                    </li>
                    <li class="pull-left ">
                        <a data-href="#fuJian">关键附件</a>
                    </li>
                </ul>
            </li>
            <li class="pull-left edit-tabs-li1 myActiveBox active">
<!--                <a href="--><?php //echo Url::toRoute(['project/access-audit', 'package_id' => $packageId, 'project_id' =>
//                    $projectId]); ?><!--">审核状况</a>-->
                审核情况
                <ul class="edit-tabs-ul2" style="display: block;">
                    <li class="pull-left myActive">
                        <a href="###">访问审核情况</a>
                    </li>
                </ul>
            </li>
            <li class="pull-left edit-tabs-li1 myActiveBox">
                <a href="<?php echo Url::toRoute(['project-log/index', 'package_id' => $packageId, 'project_id' =>
                    $projectId]); ?>">操作日志</a>
                <ul class="edit-tabs-ul2" style="display: none;">
                    <li class="pull-left myActive">
                        <a href="###">操作记录</a>
                    </li>
                    <li class="pull-left ">
                        <a href="###">数据更新纪录</a>
                    </li>
                </ul>
            </li>
        </ul>
    </div>
</div>
<!-- 页内导航   结束-->


<div class="container content content2 access_audit">
    <div class="row">
        <div class="content-right pull-right  col-md-12">
            <div class="maintenance row mb10 ">
                <!-- <img src="image/assetPackage/edit.png" class="edit-img"> -->
                <div class="perfect-logo clearfix">
                    <img src="/image/officeHall/uploadAssetPackage/wsxx.png" class="pull-left">
                    <span class="pull-left">访问审核状况</span>
                </div>
                <div class="table-responsive pull-left table-responsive2" style="text-align:center; margin:0 auto; min-height: 500px;" >
                    <?php if (!empty($list) && is_array($list)) { ?>
                        <table class="table donot-edit maintenanceS">
                            <thead>
                            <tr>
                                <th class="text-left">审批事项</th>
                                <th class="text-left">申请人</th>
                                <th class="text-left">审批人</th>
                                <th class="text-left">审批结果</th>
                                <th class="text-left">审批意见</th>
                                <th class="text-left">审批时间</th>
                            </tr>
                            </thead>
                            <tbody class="maintenance-tbody application-type">
                            <?php
                            if (!empty($list) && is_array($list)) {
                                foreach ($list as $value) {

                                    echo '<tr>
                                        <td>
                                        	<span class="txt-cut">访问审批</span>
                                        </td>
                                        <td>
                                        	<span class="txt-cut">'.$value['proposer'].'</span>
                                         </td>
                                        <td>
                                        	<span class="txt-cut">'.$value['user_id'].'</span>
                                         </td>
                                        <td>
                                        	<span class="txt-cut">'.$value['result'].'</span>
                                         </td>
                                        <td>
                                        	<span class="txt-cut application-not">'.$value['note'].'</span>
                                         </td>
                                        <td>
                                        	<span class="txt-cut" style="width: 120px;">'.$value['reviewed_at'].'</span>
                                         </td>
                                    </tr>';

//                              echo '<tr>
//                                      <td><input type="text" value="访问审批" disabled style="background-color: #ffffff"></td>
//                                      <td><input type="text" value="'.$value['proposer'].'" disabled></td>
//                                      <td><input type="text" value="'.$value['user_id'].'" disabled></td>
//                                      <td><input type="text" value="'.$value['result'].'" disabled></td>
//                                      <td><input type="text" value="'.$value['note'].'" disabled></td>
//                                      <td><input type="text" value="'.$value['reviewed_at'].'" disabled></td>
//                                  </tr>';
                                }
                            }
                            ?>

                            </tbody>
                        </table>
                    <?php } else {
                        echo Html::img('@web/image/defaultPage/nothing.png',['style'=>'display: inline-block;width:100%']);
                    }?>
                </div>
            </div>
        </div>
    </div>
</div>

<input type="hidden" id="project_id" value="<?php echo $projectId; ?>">
<input type="hidden" id="package_id" value="<?php echo $packageId; ?>">

<?php
$js = <<<JS
    $(function() {
        var project_id = $('#project_id').val(),
            package_id = $('#package_id').val();
      
        $(".like").on('click', function () {
            var value = $(this).attr('data').split('-');
            var url = '/project/set-project-like';
            if (value[2] == 2) {
                url = '/project/set-project-light';
            }
            $.get(url, {'project_id': project_id, 'del': value[1], 'type': value[2]}, function (res) {
                if (res.status) {
                    $("#" + value[0] + "_img").attr('src', res.img);
                    $("#" + value[0]).attr('data', value[0] + '-' + res.type + '-' + value[2]);
                    if (res.type == 1 && value[2] == 1) {
                        $('#myModalLabel').modal('show');
                    } else {
                        layer.msg(res.msg);
                    }
                } else {
                    layer.msg(res.msg);
                }
            });
       });
        
        $(document).on('click', '#getBase,#getJudicial,#getPingGu,#getExplain,#getMake,#getMain,#getTeam', (function () {
            var postionVal = $(this).data('val');
            $.get('/project/get-base-data', {
                'project_id': project_id,
                'postion': postionVal,
                'package_id': package_id
            }, function (res) {
                switch (postionVal) {
                    case 1:
                        $("#jiBenXinXiEdit").html(res);
                        $("#jiBenXinXiEdit").show();
                        $(".jiBenXinXiW").hide();
                        break;
                    case 3:
                        $(".siFaEdit").html(res);
                        $(".siFaEdit").show();
                        $(".siFaW").hide();
                        break;
                    case 5:
                        $(".jiaZhiPingGuEdit").html(res);
                        $(".jiaZhiPingGuEdit").show();
                        $(".jiaZhiPingGuW").hide();
                        break;
                    case 7:
                        $(".buChongShuoMingEdit").html(res);
                        $(".buChongShuoMingEdit").show();
                        $(".buChongShuoMingW").hide();
                        break;
                    case 9:
                        $(".zhuanRangXinXiEdit").html(res);
                        $(".zhuanRangXinXiEdit").show();
                        $(".zhuanRangXinXiW").hide();
                        break;
                    case 11:
                        $(".liuZhuanJiWieHuEdit").html(res);
                        $(".liuZhuanJiWieHuEdit").show();
                        $(".liuZhuanJiWieHuW").hide();
                        break;
                    case 13:
                        $(".tuanDuiChengYuanEdit").html(res);
                        $(".tuanDuiChengYuanEdit").show();
                        $(".tuanDuiChengYuanW").hide();
                        break;
                    default:
                        $("#jiBenXinXiEdit").html(res);
                        $("#jiBenXinXiEdit").show();
                        $(".jiBenXinXiW").hide();
                        break;
                }
            })
        }))
    })
JS;
$this->registerJs($js);
?>

<?php
$cssString = <<<CSS
.yz {
	position: relative;
}

.yz label {
	position: absolute;
	left: 5px;
    top: 30px;
}

.wrap {
    margin-top: 134px!important;
}

.edit-tabs {
    top: 10px;
}
.zhaiQuanQingKuang {
    margin-top: 20px;
}

.access_audit{
    margin-top: -70px;
}

.access_audit table tr td:first-child { 
    background-color: #FFFFff;
}

.maintenance .table tr td {
    line-height: 22px; 
}

.txt-cut {
	font-size:12px;
	color:#333;
}
.wrap > .container-fluid > .container{width: 100%; padding: 0; margin: 0; }

.edit-tabs-ul1>li>a{
    display: inline-block;
    width: 105px;
    margin-left: -10px;
}

CSS;
$this->registerCss($cssString);
?>

